package cn.wenxin_zhang.smart4j.plus.proxy;

import net.sf.cglib.proxy.MethodProxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smart4j.framework.proxy.Proxy;

import java.lang.reflect.Method;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * Created by Wenxin on 2017/3/10.
 */
public abstract class LifeCycleAspect implements Proxy {

    protected abstract void begin(Class<?> targetClass, Method method, Object[] params);

    protected abstract void before(Class<?> targetClass, Method method, Object[] params);

    protected abstract boolean intercept(Class<?> cls, Method method, Object[] params) throws Throwable;

    protected abstract void error(Class<?> targetClass, Method method, Object[] params, Exception e) throws Exception;

    protected abstract void afterReturn(Class<?> targetClass, Method method, Object[] params, Object result);

    protected abstract void after(Class<?> targetClass, Method method, Object[] params) throws Exception;

    protected abstract void end(Class<?> targetClass, Method method, Object[] params) throws Exception;


}
